package map;

import java.io.Serializable;
import java.util.Random;

public class Map implements Serializable {

	private static final long serialVersionUID = -8056828949109869120L;
	private Level[][] rooms;
	private int width;
	private int height;

	private int xPosStart = 0;
	private int yPosStart = 0;

	public Map(int width, int height) {
		this.rooms = new Level[width][height];
		this.width = width;
		this.height = height;


		determineStartRoomPos();
	}


	private void determineStartRoomPos() {
		Random random = new Random();

		xPosStart = random.nextInt(width);
		yPosStart = random.nextInt(height);
	}

	public Level[][] getRooms() {
		return rooms;
	}

	public void setRooms(Level[][] rooms) {
		this.rooms = rooms;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getxPosStart() {
		return xPosStart;
	}

	public void setxPosStart(int xPosStart) {
		this.xPosStart = xPosStart;
	}

	public int getyPosStart() {
		return yPosStart;
	}

	public void setyPosStart(int yPosStart) {
		this.yPosStart = yPosStart;
	}
	
	public Level getRoomAtPos(int x, int y) {
		return rooms[x][y];
	}
	
	public void setRoomAtPos(int x, int y, Level room) {
		this.rooms[x][y] = room;
	}

}
